package javango.forms.fields;

import javango.forms.widgets.WidgetFactory;

import com.google.inject.ImplementedBy;

/**
 * Helper factory to create field instances.
 * 
 * @author johns
 *
 */
@ImplementedBy(FieldFactoryImpl.class)
public interface FieldFactory {

	// just a utility function,  prevents the injector from being passes as much (maybe).
	public <T> T newField(Class<T> clazz);
	
	/**
	 * Returns the correct field to represent the provided class,  or CharField if non matches
	 * @param clazz
	 * @return
	 */
	public Field newFieldForClass(Class<?> type);
	
	public WidgetFactory getWidgetFactory();
}
